#include <avr/eeprom.h>
#include "Arduino.h"



#ifndef MEMORY_H
#define MEMORY_H 

//address define

#define addrModulePiec		0x00
#define addrModuleKolektor      0x01
#define addrModuleGrzejnik	0x02
#define addrModuleCircul	0x03

#define addrTempMixKalor        0x04
#define addrTempMixBoiler       0x05

#define addrHisMixKalor         0x06
#define addrHisMixBoiler        0x07
#define addrHisKolektor         0x08

#define addrBaseKalor		0x32 //50   eeprom 50-150
#define addrBaseKociol		0xC8 //200   eeprom 200-235


#define eepromTrue		0xFF
#define eepromFalse		0x00

//Mega 4096 bytes 

class Memory {

private:
    
  uint8_t scheduleTempKalor[24][3];
  uint8_t scheduleTempKociol[8][3];
  
  void loadSchudleTempKalor(void);
  void loadSchudleTempKociol(void);
  
  uint8_t read(uint16_t);
  void write(uint16_t , uint8_t);

public:
  void initialize();

  bool getModulePiec(void);
  bool getModuleKolektor(void);
  bool getModuleGrzejnik(void);
  bool getModuleCircul(void);

  void setModulePiec(bool);    
  void setModuleKolektor(bool); 
  void setModuleGrzejnik(bool);
  void setModuleCircul(bool);

  uint8_t getHisMixKalor(void);
  uint8_t getHisMixBoiler(void);
  uint8_t getHisKolektor(void);
  
  void setHisMixKalor(uint8_t);
  void setHisMixBoiler(uint8_t);
  void setHisKolektor(uint8_t);

};

extern Memory mem;

#endif
